	var index = _danmu = 0;
	$(document).keydown(function(event){
		var keyCode = event.keyCode;
		//alert(keyCode);
		switch(keyCode)
		{
		case 77:
			$("#qrcode").trigger('click');
			break;
		case 68:
			$("#danmu").trigger('click');
			break;
		default:
		  break;
		} 
	});
	$("#qrcode").click(function(){
		if(index > 0){
				layer.close(index);
				index = 0;
		}else{
			var src = $(this).find('img').attr('src');
			index = layer.open({
			  type: 1,
			  title: false,
			  area:['35%',''],
			  content: '<div class="padding"><img width="100%" src="'+src+'"/><p class="text-center text-large"><span class="icon-comments text-green "></span> '+canyu+'</p></div>',
			  cancel: function(){ index = 0; }
			});
		}
	});
	$("#danmu").click(function(){
		if(_danmu > 0){
			$(".screen").toggle(0);
			clearTimeout(setTime);
			_danmu = 0;
		}else{
			$(".screen").toggle(0);
			setTimeout('danmu()',0);
			_danmu = 1;
		}
	})
	$('#fullscreen').click(function(){
		if($('#fullscreen').hasClass('in')){
			exitFullscreen();
			$('#fullscreen').removeClass("in"); 
		}else{   
			fullscreen();
			$('#fullscreen').addClass("in"); 
		}
		
	});

	function fullscreen(){
		elem=document.body;
		if(elem.webkitRequestFullScreen){
			elem.webkitRequestFullScreen();   
		}else if(elem.mozRequestFullScreen){
			elem.mozRequestFullScreen();
		}else if(elem.requestFullScreen){
			elem.requestFullscreen();
		}else{
			//浏览器不支持全屏API或已被禁用
		}
	}

	function exitFullscreen(){
		var elem=document;
		if(elem.webkitCancelFullScreen){
			elem.webkitCancelFullScreen();    
		}else if(elem.mozCancelFullScreen){
			elem.mozCancelFullScreen();
		}else if(elem.cancelFullScreen){
			elem.cancelFullScreen();
		}else if(elem.exitFullscreen){
			elem.exitFullscreen();
		}else{
			//浏览器不支持全屏API或已被禁用
		}
	}
	$('body').delegate('.control','mouseover',function(){
		$(this).css('bottom','0');
	});
	$('body').delegate('.control','mouseout',function(){
		$(this).css('bottom','-68px');
	});
	var control = setTimeout(function(){
		$('.control').css('bottom','-68px');
		clearTimeout(control);
	},3000);